package day04;

import java.util.Scanner;

public class CommandBySwitch {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (true) {
            System.out.println("请选择功能：1.取款 2.存款 3.查询余额 4.退卡");
            int command = scanner.nextInt();
            boolean b = command==4;
            if (!b) {
                switch (command) {
                    case 1:
                        System.out.println("取款业务");
                        break;
                    case 2:
                        System.out.println("存款业务");
                        break;
                    case 3:
                        System.out.println("查询余额");
                        break;
                    default:
                        System.out.println("选择有误，请重新选择：");
                        break;
                }
            }else {
                System.out.println("退卡");
                break;
            }
        }
    }
}

